package entity.object;

import entity.Direction;
import entity.GameEntity;
import entity.Position;

public class PersoEntity extends GameEntity
{
	protected Direction _direction = null;
	protected Integer _vision = null;

	public PersoEntity(Integer pId, Position pPosition)
	{
		super( pId, pPosition,GameEntityType.PLAYER.getValue() );
	}

	public void setPosition( Position pPosition )
	{
		if ( pPosition.getX() > getPosition().getX() )
		{
			_direction = Direction.EAST;
		}
		else if ( pPosition.getX() < getPosition().getX() )
		{
			_direction = Direction.WEST;
		}
		else if ( pPosition.getY() > getPosition().getY() )
		{
			_direction = Direction.SOUTH;
		}
		else if ( pPosition.getY() < getPosition().getY() )
		{
			_direction = Direction.NORTH;
		}
		super.setPosition( pPosition );
	}

	public Direction getDirection()
	{
		return _direction;
	}

	public Integer getVision()
	{
		return _vision;
	}

	public void setVision( Integer pVision )
	{
		_vision = pVision;
	}

}
